#ifndef PARTICLE_INTEGRATOR_HEADER
#define PARTICLE_INTEGRATOR_HEADER

#include "Particle.h"

class EulerIntegratorFunctor {
public:
	void Integrate ( ParticleIter & it, float ts, float inDensity ) {
		//it.vel() += mGravity*; //+ F/m
		/*it.pos() += it.vel()*ts;
		it.vel() += (it.force()/inDensity)*ts;
		it.force() = glm::vec3(0,0,0);*/
		
		glm::vec3 accel =  (it->f / it->mass);
		
		it->vel += 0.5f*(it->lastA + accel)*ts;
		it->pos += it->vel*ts + 0.5f*it->lastA*(ts*ts);

		it->lastA = accel;
		it->f = glm::vec3(0,0,0);
	}
};


#endif
